package com.op.crm.webapp.action.security;

import java.io.PrintWriter;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

import net.sf.json.JSONObject;
import net.sf.json.JsonConfig;

import com.op.crm.persist.model.Action;
import com.op.crm.util.DateUtil;
import com.op.crm.util.Utils;

public class DeleteActionFunction extends SecurityFactory<Action>{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Override
	public Action getModel() {
		if (actionParam == null)
			actionParam = new Action();
		return actionParam;
	}
	
	@Override
	public String execute() throws Exception {
		try {
			if (Utils.isBlank(actionParam.getActionId())) {
				setReturnValue("错误:动作代码为空!");
				return null;
			}
			
			
			securityService.deleteAction(actionParam.getActionId());
			
			setReturnValue("信息:删除动作成功");
		} catch (Exception e) {
			e.printStackTrace();
			setReturnValue("错误:系统异常，请联系管理员!");
			return null;
		}
		
		return null;
	}
}
